<template>
    <div>
        <van-nav-bar title="搜索" left-text="返回" left-arrow @click-left="onClickLeft" />
        <van-search v-model="value" placeholder="请输入搜索关键词" />
        <div v-for="item in qsearch">
            <!-- <router-link :to="/xq/"> -->
                <van-cell :title="item.goods_name" />
            <!-- </router-link> -->
        </div>
        <h4>搜索历史</h4>
        <div style="width: 100%;height: 30px;">智利干露</div>
        <div style="width: 100%;height: 30px;">智利干露</div>
        <h4>搜索发现</h4>
        <div style="width: 100%;height: 30px;">智利干露</div>
        <div style="width: 100%;height: 30px;">自行车</div>
        <div style="width: 100%;height: 30px;">进口红酒</div>
    </div>
</template>

<script setup>
import { ref, watch } from 'vue';
import { qsearchApi } from '@/api/api'
let qsearch = ref([])
let value = ref('')
watch(value, (we) => {
    qsearchApi(we).then(res => {
        console.log('搜索数据', res);
        qsearch.value = res.data.message
    })
})
</script>

<style lang="scss" scoped></style>